home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nivb / nsinfo.frm < prev    next >
Text File  |  1995-05-07  |  6KB  |  199 lines

  1. VERSION 2.00
  2. Begin Form NameSpaceInfoForm 
  3.    Caption         =   "Name Space Information"
  4.    ClientHeight    =   4980
  5.    ClientLeft      =   870
  6.    ClientTop       =   1530
  7.    ClientWidth     =   4680
  8.    Height          =   5385
  9.    Left            =   810
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   4980
  12.    ScaleWidth      =   4680
  13.    Top             =   1185
  14.    Width           =   4800
  15.    Begin ListBox DataStreamList 
  16.       Height          =   615
  17.       Left            =   1560
  18.       TabIndex        =   11
  19.       Top             =   2640
  20.       Width           =   3015
  21.    End
  22.    Begin ListBox NameSpaceList 
  23.       Height          =   1200
  24.       Left            =   1560
  25.       TabIndex        =   9
  26.       Top             =   1320
  27.       Width           =   3015
  28.    End
  29.    Begin CommandButton OKButton 
  30.       Caption         =   "&OK"
  31.       Height          =   372
  32.       Left            =   1800
  33.       TabIndex        =   0
  34.       Top             =   4560
  35.       Width           =   1092
  36.    End
  37.    Begin Label Label8 
  38.       Caption         =   "Name spaces marked by a tilde (~) are not supported by the operating system on the selected server."
  39.       Height          =   612
  40.       Left            =   360
  41.       TabIndex        =   14
  42.       Top             =   3840
  43.       Width           =   3972
  44.    End
  45.    Begin Label Label7 
  46.       Caption         =   "Name spaces or data streams marked by an asterisk (*) are not supported by the volume."
  47.       Height          =   372
  48.       Left            =   360
  49.       TabIndex        =   13
  50.       Top             =   3360
  51.       Width           =   3852
  52.    End
  53.    Begin Label Label6 
  54.       Alignment       =   1  'Right Justify
  55.       Caption         =   "Data streams supported:"
  56.       Height          =   372
  57.       Left            =   240
  58.       TabIndex        =   12
  59.       Top             =   2520
  60.       Width           =   1212
  61.    End
  62.    Begin Label Label5 
  63.       Alignment       =   1  'Right Justify
  64.       Caption         =   "Name spaces supported:"
  65.       Height          =   372
  66.       Left            =   120
  67.       TabIndex        =   10
  68.       Top             =   1200
  69.       Width           =   1332
  70.    End
  71.    Begin Label NumDataStreamLabel 
  72.       Height          =   252
  73.       Left            =   2400
  74.       TabIndex        =   8
  75.       Top             =   840
  76.       Width           =   2052
  77.    End
  78.    Begin Label NumNameSpaceLabel 
  79.       Height          =   252
  80.       Left            =   2400
  81.       TabIndex        =   7
  82.       Top             =   600
  83.       Width           =   2052
  84.    End
  85.    Begin Label VolumeLabel 
  86.       Height          =   252
  87.       Left            =   2400
  88.       TabIndex        =   6
  89.       Top             =   360
  90.       Width           =   2052
  91.    End
  92.    Begin Label ServerLabel 
  93.       Height          =   252
  94.       Left            =   2400
  95.       TabIndex        =   5
  96.       Top             =   120
  97.       Width           =   2172
  98.    End
  99.    Begin Label Label4 
  100.       Alignment       =   1  'Right Justify
  101.       Caption         =   "Number of Data Streams:"
  102.       Height          =   252
  103.       Left            =   120
  104.       TabIndex        =   4
  105.       Top             =   840
  106.       Width           =   2172
  107.    End
  108.    Begin Label Label3 
  109.       Alignment       =   1  'Right Justify
  110.       Caption         =   "Number of Name Spaces:"
  111.       Height          =   252
  112.       Left            =   120
  113.       TabIndex        =   3
  114.       Top             =   600
  115.       Width           =   2172
  116.    End
  117.    Begin Label Label2 
  118.       Alignment       =   1  'Right Justify
  119.       Caption         =   "Volume:"
  120.       Height          =   252
  121.       Left            =   720
  122.       TabIndex        =   2
  123.       Top             =   360
  124.       Width           =   1572
  125.    End
  126.    Begin Label Label1 
  127.       Alignment       =   1  'Right Justify
  128.       Caption         =   "Server:"
  129.       Height          =   252
  130.       Left            =   840
  131.       TabIndex        =   1
  132.       Top             =   120
  133.       Width           =   1452
  134.    End
  135. End
  136.  
  137. Sub Form_Unload (Cancel As Integer)
  138.     SetPreferredConnectionID (originalPrefConnID%)
  139. End Sub
  140.  
  141. Sub OKButton_Click ()
  142.     Unload NameSpaceInfoForm
  143. End Sub
  144.  
  145. Sub Form_Load ()
  146.     Dim buffer As NWBUFFER
  147.     Dim nameSpaceName As String * 16
  148.     Dim dataStreamName As String * 48
  149.  
  150.     ccode% = GetConnectionID(serverName$, connID%)
  151.     If (ccode% <> SUCCESSFUL) Then
  152.         MsgBox "Unable to get connection ID of server " + serverName$, MB_OK, "Error"
  153.     Else
  154.         Unload NameSpaceForm
  155.         SetPreferredConnectionID (connID%)
  156.         ccode% = GetVolumeNumber(volumeName$, volume%)
  157.         ccode% = FillNameSpaceBuffer(connID%, volume%, buffer)
  158.  
  159.         If (ccode% <> SUCCESSFUL) Then
  160.             MsgBox "Unable to get name space information", MB_OK, "Error"
  161.         Else
  162.             ccode% = GetNumNameSpaceAndDataStreams(buffer, numNameSpaces%, numDataStreams%)
  163.  
  164.             ns = 0
  165.             nsFound = 1
  166.             Do
  167.                 ccode% = GetNameSpaceInfo(buffer, ns, nameSpaceName, osReady%, volSupports%)
  168.                 nsName = Left$(nameSpaceName, InStr(nameSpaceName, Chr$(0)) - 1)
  169.                 If (ccode% = SUCCESSFUL) Then
  170.                     nsFound = nsFound + 1
  171.                     If (volSupports% = 0) Then nsName = nsName + "*"
  172.                     If (osReady% = 0) Then nsName = nsName + "~"
  173.                     NameSpaceList.AddItem nsName
  174.                 End If
  175.                 ns = ns + 1
  176.             Loop While ((ns < 10) And (nsFound < numNameSpaces%))
  177.  
  178.             ds = 0
  179.             dsFound = 1
  180.             Do
  181.                 ccode% = GetDataStreamInfo(buffer, ds, dataStreamName, volSupports%)
  182.                 dsName = Left$(dataStreamName, InStr(dataStreamName, Chr$(0)) - 1)
  183.                 If (ccode% = SUCCESSFUL) Then
  184.                     dsFound = dsFound + 1
  185.                     If (volSupports% = 0) Then dsName = dsName + "*"
  186.                     DataStreamList.AddItem dsName
  187.                 End If
  188.                 ds = ds + 1
  189.             Loop While ((ds < 10) And (dsFound < numDataStreams%))
  190.  
  191.             ServerLabel = serverName$
  192.             VolumeLabel = volumeName$
  193.             NumNameSpaceLabel = Format$(numNameSpaces%)
  194.             NumDataStreamLabel = Format$(numDataStreams%)
  195.         End If
  196.     End If
  197. End Sub
  198.  
  199.